<template>
  <div>
    <van-cell :title="articleData.title" :to="'/article/' + articleData.art_id">
      <div class="images-dan" v-if="articleData.cover.type === 1">
        <van-image
          :src="articleData.cover.images[0]"
        />
      </div>
      <div slot="label">
        <div class="images-fu" v-if="articleData.cover.type === 3">
          <van-image
            v-for="(item, i) in articleData.cover.images"
            :key="i"
            :src="item"
          />
        </div>
        <span>{{ articleData.aut_name }}</span>
        <span style="margin: 0 10px">{{ articleData.comm_count }}评论</span>
        <span>{{ articleData.pubdate | formatTime }}</span>
      </div>
    </van-cell>
  </div>
</template>

<script>
export default {
  name: 'ArticleItem',
  props: {
    articleData: {
      required: true,
      type: Object
    }
  },
  data () {
    return {

    }
  },

  created () {

  },

  methods: {

  }
}
</script>

<style scoped lang='less'>
  .van-image {
    width: 232px;
    height: 146px;
  }

.images-fu {
  display: flex;
  margin: 30px 0;
  width: 95%;
  justify-content: space-around;
  .van-image {
    &:nth-child(2) {
      margin: 0 12px;
    }
  }
}
</style>
